package com.google.code.openperfmon.db;

import com.google.code.openperfmon.domain.AppUser;
import com.google.code.openperfmon.service.ServiceFactory;
import com.google.code.openperfmon.service.UserService;

public class BulkDataSetup {
	public static void main(String[] args) throws Exception {
		boolean test = args.length > 0 && "test".equals(args[0]);
		DataUtil.dbSetup(test);
		
		UserService service = ServiceFactory.getUserService();
		for (int i = 0; i < 1000; i++) {
			AppUser user = new AppUser();
			user.setAdmin(false);
			user.setEmail("user" + i + "@gmail.com");
			user.setFirstName("first " + i);
			user.setLastName("last " + i);
			user.setLogin("user " + i);
			service.saveUser(user, "test" + i);
		}
	}
}
